import { defineStore } from "pinia";
import { LocaleType } from "types/locale";
import {  useSidebarStore } from './sidebar';

interface localeState {
  localeInfo: LocaleType
}

export const useLocaleStore = defineStore('app-locale',{
  state: (): localeState => ({
    localeInfo: 'zh_CN'
  }),
  getters: {
    getLocale(): LocaleType {
      const sidebarStore = useSidebarStore()
      return sidebarStore.localeInfo
    }
  },
  actions: {
    setLocale(localeType: LocaleType) {
      this.localeInfo = localeType
    }
  }
})